package niuke.string;


import java.util.Scanner;

/**
 * @author liyuhui
 * @date {DATE}
 * @description
 */
public class LastStringLength {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str1 = scanner.nextLine();

        System.out.println(getLastWordLength(str1));

    }

    private static int getLastWordLength(String str) {
        if (isNotEmpty(str) && str.contains(" ")) {
            Integer blank = str.lastIndexOf(" ");
            return str.length() - blank -1 ;
        }else{
            return str.length();
        }
    }

    private static boolean isNotEmpty(String str1) {
        if (str1 != null && str1.trim().length() !=0){
            return true;
        }else return false;
    }
}
